package club.weiyuanstudio.java.eedemo.mybatisdemo.view;

import club.weiyuanstudio.java.eedemo.mybatisdemo.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class HtmlBook {
    BookService bookService;

    @Autowired
    public void setBookService(BookService bookService) {
        this.bookService = bookService;
    }

    @GetMapping(path = "/webbook")
    public String getBookList(Model model) {
        model.addAttribute("bookList", bookService.getAllBookService());
        return "web-book";
    }
}
